import { defineConfig } from "vite"
import { resolve } from "path"
import uni from "@dcloudio/vite-plugin-uni"
import AutoImport from "unplugin-auto-import/vite"
// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		uni(),
		AutoImport({
			// 使用
			imports: ["vue"],
			dts: "src/auto-import.d.ts",
			// 如有用到eslint记得加上写段，没有用到可以忽略
			eslintrc: {
				enabled: true,
			},
		}),
	],
	css: {
		preprocessorOptions: {
			scss: {
				additionalData: `@import "@/static/styles/vars.scss";`,
			},
		},
	},
	resolve: {
		alias: [
			{
				find: "@", // 别名
				replacement: resolve(__dirname, "src"), // 别名对应地址
			},
			{
				find: "components",
				replacement: resolve(__dirname, "src/components"),
			},
		],
	},
})
